Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Broker EventPolicy status condition set #8152

Conversation

creydr
Copy link
Member

@creydr creydr commented Aug 12, 2024

Currently we have the bug, that the Broker is still in Ready state, even when the EventPoliciesReady status condition is false:

  conditions:
  - lastTransitionTime: "2024-08-12T15:48:15Z"
    status: "True"
    type: Addressable
  - lastTransitionTime: "2024-08-12T15:48:15Z"
    message: No dead letter sink is configured.
    reason: DeadLetterSinkNotConfigured
    severity: Info
    status: "True"
    type: DeadLetterSinkResolved
  - lastTransitionTime: "2024-08-12T15:49:08Z"
    message: event policies event-policy are not ready
    reason: EventPoliciesNotReady
    severity: Info
    status: "False"
    type: EventPoliciesReady
  - lastTransitionTime: "2024-08-12T15:48:15Z"
    status: "True"
    type: FilterReady
  - lastTransitionTime: "2024-08-12T15:48:15Z"
    status: "True"
    type: IngressReady
  - lastTransitionTime: "2024-08-12T15:48:15Z"
    status: "True"
    type: Ready
  - lastTransitionTime: "2024-08-12T15:48:15Z"
    status: "True"
    type: TriggerChannelReady
  observedGeneration: 1

This PR addresses it and fixes the issue.

A test for this is added as part of #8150 (this wasn't detected in the unit tests, as the AlternateBrokerConditionSet was registered in the controller)

Release Note

Fix Broker status condition to become NotReady, when EventPoliciesReady condition is false.

@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 12, 2024
@knative-prow knative-prow bot requested a review from matzew August 12, 2024 17:54
@creydr
Copy link
Member Author

creydr commented Aug 12, 2024

/cherry-pick release-1.15

@knative-prow-robot
Copy link
Contributor

@creydr: once the present PR merges, I will cherry-pick it on top of release-1.15 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.15

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@Cali0707
Copy link
Member

this wasn't detected in the unit tests, as the AlternateBrokerConditionSet was registered in the controller

@creydr should we open a follow up issue to make the unit tests find this? I imagine we need to register the condition set somewhere in the setup code for the unit tests

Copy link
Member

@Cali0707 Cali0707 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2024
Copy link

knative-prow bot commented Aug 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, creydr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

codecov bot commented Aug 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.71%. Comparing base (c521efb) to head (c75376f).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8152      +/-   ##
==========================================
- Coverage   67.82%   67.71%   -0.11%     
==========================================
  Files         370      370              
  Lines       17885    17946      +61     
==========================================
+ Hits        12130    12152      +22     
- Misses       4983     5020      +37     
- Partials      772      774       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

knative-prow bot commented Aug 12, 2024

@creydr: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
reconciler-tests_eventing_main c75376f link true /test reconciler-tests

Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@creydr
Copy link
Member Author

creydr commented Aug 12, 2024

@creydr: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
reconciler-tests_eventing_main c75376f link true /test reconciler-tests
Your PR dashboard.

...
wait.go:200: test-kzighcbi/broker-vzibekjo condition is {"type":"Ready","status":"False","lastTransitionTime":"2024-08-12T18:42:08Z","reason":"EventPoliciesNotReady","message":"event policies eventpolicy-lwtxhfyx are not ready"}
    steps.go:47: eventing.knative.dev/v1, Resource=brokers did not become ready, timed out waiting for the condition

This is, because we have in the e2e test the installation of the EventPolicy and broker.IsReady() in the same phase:

f.Setup("Broker is ready", broker.IsReady(brokerName))
f.Setup("Broker is addressable", broker.IsAddressable(brokerName))
// Install the sink
f.Setup("Install Sink", eventshub.Install(
sink,
eventshub.StartReceiver,
))
f.Setup("Install the Trigger", trigger.Install(triggerName,
trigger.WithBrokerName(brokerName),
trigger.WithSubscriber(service.AsKReference(sink), "")))
f.Setup("Install the EventPolicy", eventpolicy.Install(
eventPolicyName,
eventpolicy.WithToRef(
broker.GVR().GroupVersion().WithKind("Broker"),
brokerName),
eventpolicy.WithFromRef(
pingsource.Gvr().GroupVersion().WithKind("PingSource"),
source,
""),
))

and the EventPolicy will only become ready in the next phase, when the pingsource gets installed.

As this test will be refactored in #8150 anyhow, I would close this PR and have the fix in the PR, where we "detected" this issue.
@Cali0707: fyi

@creydr creydr closed this Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants